package com.demo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.demo.api.UserServiceApi;
import com.demo.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：qilong sun
 * @date ：Created in 2020/7/20 13:48
 * @description：
 * @modified By：
 * @version: V1.0$
 */
@RestController
public class IndextController {
    @Reference
    private UserServiceApi userServiceApi;

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/getUser")
    public User getUser(String id) {
        User user = userServiceApi.getUser(Long.valueOf(id));
        return user;
    }
}
